package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BieHouseMapper;
import com.ruoyi.system.domain.BieHouse;
import com.ruoyi.system.service.IBieHouseService;

/**
 * 房间Service业务层处理
 * 
 * @author zxl
 * @date 2021-05-03
 */
@Service
public class BieHouseServiceImpl implements IBieHouseService 
{
    @Autowired
    private BieHouseMapper bieHouseMapper;

    /**
     * 查询房间
     * 
     * @param houseId 房间ID
     * @return 房间
     */
    @Override
    public BieHouse selectBieHouseById(String houseId)
    {
        return bieHouseMapper.selectBieHouseById(houseId);
    }

    /**
     * 查询房间列表
     * 
     * @param bieHouse 房间
     * @return 房间
     */
    @Override
    public List<BieHouse> selectBieHouseList(BieHouse bieHouse)
    {
        return bieHouseMapper.selectBieHouseList(bieHouse);
    }

    /**
     * 新增房间
     * 
     * @param bieHouse 房间
     * @return 结果
     */
    @Override
    public int insertBieHouse(BieHouse bieHouse)
    {
        bieHouse.setCreateTime(new Date());
        bieHouse.setHouseId(UUID.randomUUID().toString());
        return bieHouseMapper.insertBieHouse(bieHouse);
    }

    /**
     * 修改房间
     * 
     * @param bieHouse 房间
     * @return 结果
     */
    @Override
    public int updateBieHouse(BieHouse bieHouse)
    {
        return bieHouseMapper.updateBieHouse(bieHouse);
    }

    /**
     * 批量删除房间
     * 
     * @param houseIds 需要删除的房间ID
     * @return 结果
     */
    @Override
    public int deleteBieHouseByIds(String[] houseIds)
    {
        return bieHouseMapper.deleteBieHouseByIds(houseIds);
    }

    /**
     * 删除房间信息
     * 
     * @param houseId 房间ID
     * @return 结果
     */
    @Override
    public int deleteBieHouseById(String houseId)
    {
        return bieHouseMapper.deleteBieHouseById(houseId);
    }
}
